<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsgflatcolormaterial.cpp -->
  <title>QSGFlatColorMaterial 类 | Qt Quick 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtquick-index.html">Qt Quick 模块</a></td><td ><a href="qtquick-module.html">C++ 类</a></td><td >QSGFlatColorMaterial</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">目录</a></h3>
<ul>
<li class="level1"><a href="#public-functions">公用函数</a></li>
<li class="level1"><a href="#details">详细信息</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QSGFlatColorMaterial 类</h1>
<!-- $$$QSGFlatColorMaterial-brief -->
<p><a href="qsgflatcolormaterial.html">QSGFlatColorMaterial</a>类提供了一种在场景图中渲染纯色几何图形的便捷方式。 <a href="#details">更多...</a></p>
<!-- @@@QSGFlatColorMaterial -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign">头文件：</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QSGFlatColorMaterial&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += quick</td></tr><tr><td class="memItemLeft rightAlign topAlign">继承自：</td><td class="memItemRight bottomAlign"> <a href="qsgmaterial.html">QSGMaterial</a></td></tr></table></div><ul>
<li><a href="qsgflatcolormaterial-members.html">所有成员的列表，包括继承成员</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">公用函数</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsgflatcolormaterial.html#QSGFlatColorMaterial">QSGFlatColorMaterial</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QColor &amp;</td><td class="memItemRight bottomAlign"><b><a href="qsgflatcolormaterial.html#color">color</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsgflatcolormaterial.html#setColor">setColor</a></b>(const QColor &amp;<i>color</i>)</td></tr>
</table></div>
<ul>
<li class="fn">5 个公用函数继承自<a href="qsgmaterial.html#public-functions">QSGMaterial</a></li>
</ul>
<a name="details"></a>
<!-- $$$QSGFlatColorMaterial-description -->
<div class="descr">
<h2 id="details">详细信息</h2>
<p><a href="qsgflatcolormaterial.html">QSGFlatColorMaterial</a>类提供了一种在场景图中渲染纯色几何图形的便捷方式<a href="file:///E:/WLL/work/Qt5.12-Document-Trans-in-Chinese/qtquick/qsgflatcolormaterial.html">。</a></p>
<p><b>警告：</b>此实用程序类仅在使用 Qt Quick 场景图的 OpenGL 后端运行时才起作用。</p>
<p>纯色材质将使用纯色填充几何图形中的每个像素。颜色可以包含透明度。</p>
<p>要使用纯色材质渲染的几何图形需要<a href="file:///E:/WLL/work/Qt5.12-Document-Trans-in-Chinese/qtquick/qsggeometry.html">QSGGeometry</a>对象中属性位置 0 中的顶点才能正确渲染。QSGGeometry <a href="file:///E:/WLL/work/Qt5.12-Document-Trans-in-Chinese/qtquick/qsggeometry.html#defaultAttributes_Point2D">::defaultAttributes_Point2D</a> () 返回与此材质兼容的属性集。</p>
<p>平面颜色材质在更新其渲染状态时会同时考虑当前不透明度和当前矩阵。</p>
</div>
<!-- @@@QSGFlatColorMaterial -->
<div class="func">
<h2>成员函数文档</h2>
<!-- $$$QSGFlatColorMaterial[overload1]$$$QSGFlatColorMaterial -->
<h3 class="fn" id="QSGFlatColorMaterial"><a name="QSGFlatColorMaterial"></a>QSGFlatColorMaterial::<span class="name">QSGFlatColorMaterial</span>()</h3>
<p>构造一个新的平面颜色材质。</p>
<p>默认颜色为白色。</p>
<!-- @@@QSGFlatColorMaterial -->
<!-- $$$color[overload1]$$$color -->
<h3 class="fn" id="color"><a name="color"></a>const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &amp;QSGFlatColorMaterial::<span class="name">color</span>() const</h3>
<p>返回此平面颜色材料的颜色。</p>
<p>默认颜色为白色。</p>
<p><b>请参考 </b><a href="qsgflatcolormaterial.html#setColor">setColor</a>()。</p>
<!-- @@@color -->
<!-- $$$setColor[overload1]$$$setColorconstQColor& -->
<h3 class="fn" id="setColor"><a name="setColor"></a><span class="type">void</span> QSGFlatColorMaterial::<span class="name">setColor</span>(const <span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> &amp;<i>color</i>)</h3>
<p>将此平面颜色材料的颜色设置为<i>color</i>。</p>
<p><b>请参考 </b><a href="qsgflatcolormaterial.html#color">color</a>()。</p>
<!-- @@@setColor -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
